<?php

  include './myinclude/common.inc.php';

  $g_db = new Mysql_Cls($mysqlConfig);

  //获取热销手机列表
  $sql = " SELECT * FROM cj_mobile_phone WHERE moep_hot_sale=1  ORDER BY moep_id DESC LIMIT 0,10 ";
  $g_db->query($sql);
  while($row = $g_db->fetch_array()){
	  $hostSalePhone[] = $row;
  }

  //获取新闻列表

  $page = $_GET['page'] ? $_GET['page'] : 1 ;
  $perpage = 10;
  $start = ($page-1) * $perpage;
  $limit = 'LIMIT '.$start.','.$perpage;


  $sql = " SELECT SQL_CALC_FOUND_ROWS * FROM cj_mobile_article    ORDER BY moea_id DESC  ".$limit;
  $g_db->query($sql);
  while($row = $g_db->fetch_array()){
	  $newsList[] = $row;
  }
  $sql = " SELECT FOUND_ROWS() as num";
  $g_db->query($sql);  
  $row = $g_db->fetch_array();
  $countNews = $row['num'];

  $pagestr = multi($countPhone, $perpage, $page, '?'.$query);  
  
  

  include './mytpl/news.php';
?>

